<template>
	<div class="store_list table-theme">
		<head-title title="合作--店铺列表"></head-title>
		<el-card>
			<div class="top-menu">
				<div class="menu-left">
					<!-- <select-view
						:option-list="classifyList"
						:value="type"
						placeholder="商家类型"
						type="type"
						@value="setSelectValue"
						multiple
					>
					</select-view> -->
					<select-view
						:option-list="statusList"
						:value="is_status"
						placeholder="类型"
						type="is_status"
						@value="setSelectValue"
					>
					</select-view>
					<!-- <select-view
						:option-list="attract_list"
						:value="attract_id"
						placeholder="请选择"
						type="attract_id"
						@value="setSelectValue"
						label-name="nickname"
						value-name="user_id"
						multiple
					>
					</select-view> -->
					<select-view
						:option-list="service_list"
						:value="service_id"
						placeholder="请选择"
						type="service_id"
						@value="setSelectValue"
						label-name="nickname"
						value-name="user_id"
						multiple
					>
					</select-view>
					<select-view
						:option-list="money_label_list"
						:value="money_label"
						placeholder="请选择"
						type="money_label"
						@value="setSelectValue"
						label-name="label_name"
						value-name="label_name"
						multiple
					>
					</select-view>
					<select-view
						:option-list="levelList"
						:value="level"
						placeholder="请选择"
						type="level"
						@value="setSelectValue"
						multiple
					>
					</select-view>
					<!-- <select-view
						:option-list="cityJson"
						:value="province"
						placeholder="请选择省"
						type="province"
						@value="setSelectValue"
						label-name="areaName"
						value-name="areaId"
						multiple
					>
					</select-view> -->
					<select-view
						:option-list="filialeList"
						:value="filiale_id"
						placeholder="请选择公司"
						type="filiale_id"
						@value="setSelectValue"
						label-name="name"
						value-name="filiale_id"
						multiple
					>
					</select-view>
					<select-view
						:option-list="storeTypeList"
						:value="store_type"
						placeholder="店铺类型"
						type="store_type"
						@value="setSelectValue"
					>
					</select-view>
					<select-view
						:option-list="payStatusList"
						:value="pay_status"
						placeholder="是否已下单"
						type="pay_status"
						@value="setSelectValue"
					>
					</select-view>
					<el-date-picker
            v-model="timeRange"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            value-format="yyyy-MM-dd"
            @change="init()"
          >
          </el-date-picker>
				</div>
				<div class="menu-right">
					<refresh-button @refresh="refreshPage"></refresh-button>
					<search-view :option="optionList" :classSelects="classSelect" :selectContents="selectContent" @value="goSearch" @clear="refreshPage"></search-view>
				</div>
			</div>
			<p class="data-number">总店铺数：{{ total }}</p>
			<el-table :data="storeList">
				<el-table-column label="店铺ID" align="center" prop="store_id" width="80"></el-table-column>
				<el-table-column label="有效期" align="center" prop="expire_time"  min-width="120"></el-table-column>
				<el-table-column label="店铺名称" align="center" prop="store_name"></el-table-column>
				<!-- <el-table-column label="合同编号" align="center" prop="contract_sn"></el-table-column> -->
				<el-table-column label="业绩员" align="center" prop="service_id_name"></el-table-column>
				<el-table-column label="招商员" align="center" prop="attract_id_name"></el-table-column>
				<el-table-column label="发货员" align="center" prop="warehouse_id_name"></el-table-column>
				<el-table-column label="所属公司" align="center" prop="filiale_name"></el-table-column>
				<el-table-column label="用户ID" align="center" prop="user_id" width="70"></el-table-column>
				<el-table-column label="合同简称" align="center" prop="abbreviation"></el-table-column>
				<el-table-column label="佣金系数" align="center" prop="commission_coefficient">
					<template slot-scope="scope">
						{{scope.row.commission_coefficient}}%
					</template>
				</el-table-column>
				<el-table-column label="开通时间" align="center" prop="add_time" width="100"></el-table-column>
				<el-table-column label="省份" align="center" prop="province_name" width="70"></el-table-column>
				<!-- <el-table-column label="签约状态" align="center" prop="">
					<template slot-scope="scope">
						<el-tag v-if="scope.row.ContractStatus == 1" type="danger">{{scope.row.contract_status}}</el-tag>
						<el-tag v-if="scope.row.ContractStatus == 2">{{scope.row.contract_status}}</el-tag>
					</template>
				</el-table-column> -->
				<el-table-column label="产品数" align="center" prop="">
					<template slot-scope="scope">
						<el-tooltip :content="String(scope.row.goods_count)" placement="bottom" effect="light">
							<el-tag type="danger">{{scope.row.goods_count}}</el-tag>
						</el-tooltip>
					</template>
				</el-table-column>
				<el-table-column label="推广数" align="center" prop="">
					<template slot-scope="scope">
						<el-tooltip :content="String(scope.row.total_extension)" placement="bottom" effect="light">
							<el-tag type="danger">{{scope.row.total_extension}}</el-tag>
						</el-tooltip>
					</template>
				</el-table-column>
				<el-table-column label="业绩标签" align="center" prop="" min-width="150">
					<template slot-scope="scope">
						<el-tooltip :content="scope.row.money_lable || '0'" placement="bottom" effect="light">
							<el-tag type="danger">{{scope.row.money_lable || 0}}</el-tag>
						</el-tooltip>
					</template>
				</el-table-column>
				<el-table-column label="注册人/电话" align="center" prop="" min-width="150">
					<template slot-scope="scope">
						<p>{{ scope.row.contract_name }}</p>
						<p>{{ scope.row.contract_phone }}</p>
					</template>
				</el-table-column>
				<el-table-column label="价格体系" align="center" prop="coefficient"></el-table-column>
				<el-table-column label="店铺等级" align="center">
					<template slot-scope="scope">
						<i class="el-icon-medal" v-if="scope.row.level != 0 && scope.row.level < 5" :class="filterLevelColor(scope.row.level)">
							<span>{{scope.row.level | filterLevel}}</span>
						</i>
						<el-image v-else-if="scope.row.level == 5" style="width:38px;height:24px" :src="require('../../assets/image/interior.png')" fit="cover"></el-image>
						<el-image v-else-if="scope.row.level == 6" style="width:38px;height:24px" :src="require('../../assets/image/new.png')" fit="cover"></el-image>
						<span v-else-if="scope.row.level == 7">定制</span>
						<span v-else-if="scope.row.level == 0">未设置</span>
					</template>
				</el-table-column>
				<el-table-column label="合作类型" align="center" prop="store_type_name"></el-table-column>
				<el-table-column label="累计订单金额" align="center" prop="all_money" min-width="150"></el-table-column>
				<el-table-column label="累计佣金额" align="center" prop="total_commission" min-width="150"></el-table-column>
				<el-table-column label="是否有物流点" align="center"  min-width="150">
					<template slot-scope="scope">
						<p style="cursor: pointer;" @click="goLogisticsList(scope.row.user_id,scope.row.store_id)">{{scope.row.delivery_count == 0 ? '无物流点':'有物流点'}}</p>
					</template>
				</el-table-column>

				<el-table-column label="上下架" align="center">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.is_status" :active-value="1" :inactive-value="2" @change="upDown($event, scope.row.store_id)"></el-switch>
					</template>
				</el-table-column>
				<el-table-column label="操作" align="center" width="220" fixed="right">
					<template slot-scope="scope">
						<el-button class="operate-btn" type="primary" size="mini" @click="edit(scope.row.store_id)">编辑</el-button>
						<el-button class="operate-btn" type="primary" size="mini" @click="showDialog(0, scope.$index)">详情</el-button>
						<el-button class="operate-btn" type="primary" size="mini" @click="showDialog(1, scope.row)">归属</el-button>
						<el-button class="operate-btn" v-if="scope.row.ContractStatus == 2 || scope.row.ContractStatus == 3" v-show="admin_id == 11 || admin_id == 1 || admin_id == 8 || admin_id == 12 || admin_id == 5 ||admin_id == 4"
						 type="primary" size="mini" @click="PrintContract(scope.row.url)">下载合同</el-button>
						<!-- <el-button class="operate-btn" type="primary" size="mini" @click="showDialog(2, scope.row)" v-if="admin_id == 1 || admin_id == 23 || admin_id == 8">小程序配置</el-button> -->
						<el-button class="operate-btn" type="primary" size="mini" @click="showDialog(3,scope.row)" v-if="admin_id == 4 || admin_id == 1 || admin_id == 8 || admin_id == 12">续费</el-button>
						<el-button class="operate-btn" type="primary" size="mini" @click="onSetDefaultStore(scope.row.store_id)" v-if="admin_id == 1 && scope.row.default_id == 0">设置默认</el-button>
						<el-button class="operate-btn" type="primary" size="mini" @click="onOpenDate(scope.row.store_id)" v-if="admin_id == 1 || admin_id == 8 || admin_id == 12 || admin_id == 5">店铺数据</el-button>
						<el-button class="operate-btn" type="primary" size="mini" @click="onOpen('staff',scope.row.store_id)" v-if="admin_id == 1 || admin_id == 8 || admin_id == 12 || admin_id == 5">店铺员工</el-button>
						<el-button class="operate-btn" type="primary" size="mini" @click="onOpen('follow-up',scope.row.store_id)" v-if="admin_id == 1 || admin_id == 8 || admin_id == 12 || admin_id == 5">跟进状态</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div class="pages">
				<el-pagination background layout="prev, pager, next, jumper" :total="total" @current-change="init" :current-page="page"></el-pagination>
			</div>
		</el-card>

		<!-- 归属弹框 -->
		<el-dialog title="归属" :visible.sync="ascriptionDialog" width="500px" center :modal-append-to-body="false">
			<el-form :model="ascriptionForm" :rules="ascriptionFormRules" ref="ascriptionForm" label-width="90px">
				<el-form-item label="合同简称:" prop="abbreviation">
					<el-input placeholder="请输入合同简称" v-model="ascriptionForm.abbreviation"></el-input>
				</el-form-item>
				<el-form-item label="签约人员:" prop="attract_id">
					<el-select v-model="ascriptionForm.attract_id" placeholder="请选择" style="width: 100%">
						<el-option v-for="item in attract_list" :key="item.user_id" :label="item.nickname" :value="item.user_id"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="业绩人员:" prop="service_id">
					<el-select v-model="ascriptionForm.service_id" placeholder="请选择" style="width: 100%">
						<el-option v-for="item in service_list" :key="item.user_id" :label="item.nickname" :value="item.user_id"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="发货人员:" prop="warehouse_id">
					<el-select v-model="ascriptionForm.warehouse_id" placeholder="请选择" multiple style="width: 100%">
						<el-option v-for="item in warehouse_list" :key="item.user_id" :label="item.nickname" :value="item.user_id"></el-option>
					</el-select>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="ascriptionDialog = false">取 消</el-button>
				<el-button type="primary" @click="confirmClick(0, 'ascriptionForm')">确 定</el-button>
			</span>
		</el-dialog>

		<!-- 小程序配置弹框 -->
		<el-dialog title="配置信息" :visible.sync="UpWxInfoDialog" width="500px" center :modal-append-to-body="false">
			<el-form :model="UpWxInfoForm" :rules="UpWxInfoFormRules" ref="UpWxInfoForm" label-width="120px">
				<el-form-item label="小程序ID:" prop="appid">
					<el-input placeholder="请输入小程序ID" v-model="UpWxInfoForm.appid"></el-input>
				</el-form-item>
				<el-form-item label="小程序密钥:" prop="secret">
					<el-input placeholder="请输入小程序密钥" v-model="UpWxInfoForm.secret"></el-input>
				</el-form-item>
				<el-form-item label="商户号:" prop="mch_id">
					<el-input placeholder="请输入微信支付商户号" v-model="UpWxInfoForm.mch_id"></el-input>
				</el-form-item>
				<el-form-item label="支付密钥:" prop="mch_key">
					<el-input placeholder="请输入微信支付密钥" v-model="UpWxInfoForm.mch_key"></el-input>
				</el-form-item>
				<el-form-item label="主体:" prop="body">
					<el-input placeholder="请填写主体信息" v-model="UpWxInfoForm.body"></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="UpWxInfoDialog = false">取 消</el-button>
				<el-button type="primary" @click="confirmClick(1, 'UpWxInfoForm')">确 定</el-button>
			</span>
		</el-dialog>
		<!-- 续费配置弹窗 -->
		<el-dialog title="续费信息" :visible.sync="UpStoreDialog" width="500px" center :modal-append-to-body="false" @close="onCloseUpStoreDialog">
			<el-form :model="UpStoreInfoForm" :rules="UpStoreInfoFormRules" ref="UpStoreInfoForm" label-width="120px">
				<el-form-item label="到期时间:" prop="expire_time">
					<el-date-picker
						v-model="UpStoreInfoForm.expire_time"
						type="datetime"
						placeholder="选择日期时间">
						</el-date-picker>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="onCloseUpStoreDialog">取 消</el-button>
				<el-button type="primary" @click="confirmClick(2,'UpStoreInfoForm')">确 定</el-button>
			</span>
		</el-dialog>
	</div>
</template>

<script>
	import editName from '@/components/layer-dialog/storeSetting.vue';
	import storeInfo from '@/components/layer-dialog/storeInfo.vue';
	import SelectView from "@/components/SelectView";
	export default {
		name: 'store_list',
		components:{
			SelectView
		},
		data() {
			return {
				attract_id:'',
				admin_id: localStorage.getItem('admin_id'),
				optionList: [{
						value: 0,
						label: '店铺用户ID'
					},
					{
						value: 1,
						label: '店铺手机'
					},
					{
						value: 2,
						label: '店铺ID'
					},
					{
						value: 3,
						label: '客服人员ID'
					},
					{
						value: 4,
						label: '招商人员ID'
					},
					{
						value: 5,
						label: '店铺名字'
					},
					{
						value: 6,
						label: '合同简称'
					},
					{
						value: 7,
						label: '注册人名字'
					}
				],
				attract_list: [],
				service_list: [],
				warehouse_list: [],
				is_status: 1, // 1上架 2下架
				ascriptionDialog: false, // 归属弹窗
				ascriptionForm: {
					abbreviation: '',
					attract_id: '',
					service_id: '',
					warehouse_id: []
				},
				ascriptionFormRules: {
					abbreviation: [{
						required: true,
						message: '请输入内容'
					}],
					attract_id: [{
						required: true,
						message: '请选择'
					}],
					service_id: [{
						required: true,
						message: '请选择'
					}],
					warehouse_id: [{
						type: 'array',
						required: true,
						message: '请选择'
					}]
				},
				UpWxInfoDialog: false, //小程序配置弹窗
				UpWxInfoForm: {
					appid: '',
					secret: '',
					mch_id: '',
					mch_key: '',
					body: '',
				},
				UpWxInfoFormRules: {
					appid: [{
						required: true,
						message: '请输入小程序ID'
					}],
					secret: [{
						required: true,
						message: '请输入小程序密钥'
					}],
					mch_id: [{
						required: true,
						message: '请输入微信支付商户号'
					}],
					mch_key: [{
						required: true,
						message: '请输入微信支付密钥'
					}],
					body: [{
						required: true,
						message: '请填写主体信息'
					}]
				},
				selectContent: '', // 分类搜索平输入框的值
				classSelect: 0, // 分类搜索
				storeList: [], // 店铺列表
				total: 0,
				totalData: 0,
				type: '',
				page: 0,
				classifyList: [{label:'直营店',value:1} ,{label:'专卖店',value:2}],
				money_label_list:[],
				money_label:'请选择业绩标签',
				UpStoreDialog:false,
				UpStoreInfoForm:{
					expire_time:''
				},
				UpStoreInfoFormRules:{
					expire_time:[{required:true,message:"请选择到期时间"}]
				},
				levelList:[
					{
						value:1,
						label:'A'
					},
					{
						value:2,
						label:'B'
					},
					{
						value:3,
						label:'C'
					},
					{
						value:4,
						label:'D'
					},
					{
						value:5,
						label:'内部'
					},
					{
						value:6,
						label:"新店"
					}
				],
				level:"请选择等级",
				cityJson:'',
				province:'',
				statusList:[
					{
						label:'上架',
						value:1
					},
					{
						label:'下架',
						value:2
					}
				],
				filialeList:[],
				filiale_id:'',
				storeTypeList:[
					{
						label:'直营店',
						value: 1
					},
					{
						label:'专卖店',
						value: 2
					},
					// {
					// 	label:'分销店',
					// 	value:4
					// },
					// {
					// 	label:'旗舰店',
					// 	value:6
					// }
				],
				store_type:'',
				service_id:'',
				pay_status: '',
				payStatusList: [{
					label: '未下单',
					value: 0
				},{
					label: '已下单',
					value: 1
				}],
				timeRange: ''
			};
		},
		methods: {
			// 初始化列表
			init(e) {
				this.cityJson = require('@/utils/city.json');
				this.page = e;
				let data = {
					page: e - 1 ? e - 1 : 0,
					limit: 10,
					type: this.type == 0 ? '' : this.type,
					is_status: this.is_status,
					order_by: 'store_id',
					asc: '2',
					attract_id:this.attract_id == 0 ? '':this.attract_id,
					money_lable:this.money_label == '请选择业绩标签'?'':this.money_label,
					level:this.level == '请选择等级'?'':this.level,
					province:this.province,
					filiale_id:this.filiale_id,
					store_type:this.store_type,
					service_id:this.service_id,
					pay_status: this.pay_status
				}
				if(this.timeRange){
					data.start_time = this.timeRange[0]
					data.end_time = this.timeRange[1]
				}else{
					data.start_time = ''
					data.end_time = ''
				}

				if (this.classSelect == 0) {
					data.user_id = this.selectContent;
				} else if (this.classSelect == 1) {
					data.phone = this.selectContent;
				} else if (this.classSelect == 2) {
					data.store_id = this.selectContent;
				} else if (this.classSelect == 3) {
					data.service_id = this.selectContent;
				} else if (this.classSelect == 4) {
					data.attract_id = this.selectContent;
				} else if (this.classSelect == 5) {
					data.keyword = this.selectContent;
				} else if (this.classSelect == 6) {
					data.abbreviation = this.selectContent;
				} else if (this.classSelect == 7) {
					data.name = this.selectContent;
				}

				this.$http(this.$ApiList.StoreList, data).then(res => {
					this.storeList = [];
					if (res.datas.length != 0) {
						let type_name = ['普通商户', '装饰公司', '定制企业'];
						res.datas.data.forEach(item => {
							let index = item.type - 1;
							item.type_name = type_name[index];
							this.storeList.push(item);
						});
						this.total = res.datas.count;
					}
				});
			},
			// 控制Dialog显示
			showDialog(type, index) {
				if (type == 0) {
					this.$layer.iframe({
						title: '详情',
						maxmin: true,
						area: ['50%', '60%'],
						content: {
							content: storeInfo, //传递的组件对象
							parent: this, //当前的vue对象
							data: {
								info: this.storeList[index]
							} //props
						}
					});
				} else if (type == 1) {
					this.ascriptionForm.store_id = index.store_id;
					this.ascriptionForm.abbreviation = index.abbreviation;
					this.ascriptionForm.attract_id = index.attract_id;
					this.ascriptionForm.service_id = index.service_id;
					this.ascriptionForm.warehouse_id = index.warehouse_ids.split(',').map(Number)
					this.ascriptionDialog = true;
					this.$nextTick(() => {
						this.$refs.ascriptionForm.clearValidate();
					});
				} else if (type == 2) {
					let data = {
						store_id: index.store_id
					};
					this.$http(this.$ApiList.StoreInfo, data).then(res => {
						if (res.datas != null) {
							this.UpWxInfoForm.appid = res.datas.appid;
							this.UpWxInfoForm.secret = res.datas.secret;
							this.UpWxInfoForm.mch_id = res.datas.mch_id;
							this.UpWxInfoForm.mch_key = res.datas.mch_key;
							this.UpWxInfoForm.body = res.datas.body;
						} else {
							this.UpWxInfoForm = {
								appid: '',
								secret: '',
								mch_id: '',
								mch_key: ''
							};
						}
						this.UpWxInfoForm.store_id = index.store_id;
						this.UpWxInfoDialog = true;
						this.$nextTick(() => {
							this.$refs.UpWxInfoForm.clearValidate();
						});
					});
				} else if (type == 3){
					this.UpStoreDialog = true;
					this.UpStoreInfoForm.store_id = index.store_id
				}
			},
			goSearch(type, value) {
				this.selectContent = value;
				this.classSelect = type;
				this.init();
			},
			refreshPage() {
				this.page = 1;
				this.type = '';
				this.selectText = '';
				this.classSelect = 1;
				this.selectContent = '';
				this.province = '';
				this.init();
			},
			//提交
			confirmClick(type, formName) {
				this.$refs[formName].validate(valid => {
					if (valid) {
						if (type == 0) {
							let postData = {
								abbreviation: this.ascriptionForm.abbreviation,
								attract_id: this.ascriptionForm.attract_id,
								service_id: this.ascriptionForm.service_id,
								warehouse_id: this.ascriptionForm.warehouse_id.length?this.ascriptionForm.warehouse_id.join(','):'',
								store_id: this.ascriptionForm.store_id,
							}
							this.$http(this.$ApiList.UpAscriptionUser, postData).then(res => {
								this.$layer.msg('操作成功');
								this.ascriptionDialog = false;
								this.page = 1;
								this.init();
							});
						} else if (type == 1) {
							this.$http(this.$ApiList.UpWxInfo, this.UpWxInfoForm).then(res => {
								this.$layer.msg('操作成功');
								this.UpWxInfoDialog = false;
								this.page = 1;
								this.init();
							});
						} else if(type == 2){
							let data = {
								store_id:this.UpStoreInfoForm.store_id,
								expire_time:Math.round(new Date(this.UpStoreInfoForm.expire_time)/1000)
							}
							this.$http(this.$ApiList.UpStoreExpire,data).then(res=>{
								this.$layer.msg(res.datas);
								this.UpStoreDialog = false;
								this.UpStoreInfoForm.expire_time = ' ';	
							}).then(()=>{
								this.init(this.page);
							})
						}
					} else {
						this.$layer.msg('请填写完整信息后提交');
					}
				});
			},
			// 上下架
			upDown(e, store_id) {
				let data = {
					store_id: store_id,
					is_status: e
				};
				this.$http(this.$ApiList.StoreDown, data).then(res => {
					this.$layer.msg('操作成功');
				});
				this.page = 1;
				this.init();
			},
			// 修改店铺信息
			edit(storeId) {
				this.$layer.iframe({
					title: '设置',
					maxmin: true,
					area: ['50%', '60%'],
					content: {
						content: editName, //传递的组件对象
						parent: this, //当前的vue对象
						data: {
							storeId: storeId
						} //props
					}
				});
			},
			getUserList() {
				this.$http(this.$ApiList.getUserList).then(res => {
					this.attract_list = res.datas.attract_list;
					this.service_list = res.datas.service_list;
					this.warehouse_list = res.datas.warehouse_list;
				});
			},
			PrintContract(url) {
				window.open(url)
			},
			goLogisticsList(id, store_id) {
				this.$router.push({
					path: '/b_logistics_list',
					query: {
						user_id: id,
						store_id: store_id
					}
				});
			},
			GetStoreMoneyLabelList(){
				this.$http(this.$ApiList.GetStoreMoneyLabelList).then(res=>{
					this.money_label_list = res.datas
				})
				this.$http(this.$ApiList.FilialeItems).then(res=>{
					this.filialeList = res.datas
				})
			},
			// 关闭店铺续费弹窗
			onCloseUpStoreDialog(){
				this.UpStoreDialog = false;
				this.$refs['UpStoreInfoForm'].resetFields();
			},
			// 设置默认
			onSetDefaultStore(store_id){
				this.$http(this.$ApiList.SetDefaultStore,{store_id}).then(res=>{
					this.$message.success(res.datas);
					this.init(this.page);
				})
			},
			filterLevelColor(data){
				switch (data) {
					case 1:
						return 'oneLevel';
						break;
					case 2:
						return 'twoLevel';
						break;
					case 3:
						return 'threeLevel';
						break;
					case 4:
						return 'fourLevel';
						break;
					default:
						break;
				}
			},
			// 跳转数据页面
			onOpenDate(store_id){
				this.$router.push({path:'/store_data',query:{store_id}})
			},
			// 跳转别的页面
			onOpen(type,id){
				if(type === 'staff'){
					this.$router.push({path:"/employee_list",query:{store_id:id}})
				}else if(type === 'follow-up'){
					this.$router.push({path:"store_progress_list",query:{store_id:id}})
				}
			},
			setSelectValue(obj){
				const { type,value } = obj
				let newVal = ''
				if(typeof value==='object'){
					newVal = value.join(',')
				}else{
					newVal = value
				}
				switch (type) {
					case 'is_status':
						this.is_status = newVal
						break;
					case 'attract_id':
						this.attract_id = newVal
						break;
					case 'money_label':
						this.money_label = newVal
						break;
					case 'level':
						this.level = newVal
						break
					case 'province':
						this.province = newVal
						break
					case 'filiale_id':
						this.filiale_id = newVal
						break
					case 'type':
						this.type = newVal
						break
					case 'store_type':
						this.store_type = newVal
						break
					case 'service_id':
						this.service_id = newVal
						break
					case 'pay_status':
						this.pay_status = newVal
						break
					default:
						break;
				}
				this.init()
			}
		},
		created() {
			if(this.$route.query.store_id){
				this.classSelect = 2;
				this.selectContent = this.$route.query.store_id;
			}
			this.init();
			this.getUserList();
			this.GetStoreMoneyLabelList();
		},
		filters: {
			filterLevel(data){
				switch (data) {
					case 1:
						return 'A';
						break;
					case 2:
						return 'B';
						break;
					case 3:
						return 'C';
						break;
					case 4:
						return 'D';
						break;
					default:
						break;
				}
			}
		}
	};
</script>
<style lang="scss">
	.store_list{
		.menu-left{
			margin-bottom: -20px;
			.select-view-box{
				margin-bottom: 20px;
			}
		}
		.el-date-editor .el-range-separator{
			padding: 0;
			width: 1em;
		}
	}
</style>
<style lang="scss" scoped>
	.store_list {
		.operate-btn {
			margin-top: 6px;
		}

		.el-table th,
		.el-table td {
			padding: 6px 0;
		}
		.el-icon-medal{
			font-size: 40px;
			position: relative;
			>span{
				position: absolute;
				bottom: 7px;
				left: 50%;
				font-size: 16px;
				font-weight: 600;
				transform: translateX(-50%);
			}
		}
		.oneLevel{
			color: #e51c23;
		}
		.twoLevel{
			color: #3c8dbc;
		}
		.threeLevel{
			color:#009688;
		}
		.fourLevel{
			color:#141414;
		}
	}
</style>
